package com.example.smartcanteen.controller;


import com.example.smartcanteen.model.Goods;
import com.example.smartcanteen.model.Order1;
import com.example.smartcanteen.service.Order1Service;
import com.example.smartcanteen.utils.ResponseMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order1")
@CrossOrigin
public class Order1Controller {
    @Autowired
    private Order1Service order1Service;


    //所需数据：int studentID；
    @PostMapping("/select")
    ResponseMessage select(int studentID) {


        return order1Service.select(studentID);
    }


    //所需数据：int shopID；
    @PostMapping("/selectByShop")
    ResponseMessage selectByShop(int shopID) {


        return order1Service.selectByShop(shopID);
    }


@PostMapping("/changeOrderStateByShop")
    ResponseMessage changeOrderStateByShop(int id){

        return order1Service.changeOrderStateByShop(id);
}


    @PostMapping("/changeOrderStateByStudent")
    ResponseMessage changeOrderStateByStudent(int id){

        return order1Service.changeOrderStateByStudent(id);
    }
//    @PostMapping("/create")
//    ResponseMessage create(Order1 order1) {
//
//
//        return order1Service.create(order1);
//    }
}
